home *** CD-ROM | disk | FTP | other *** search
- Subject: v23i106: ABC interactive programming environment, Patch1
- Newsgroups: comp.sources.unix
- Approved: rsalz@uunet.UU.NET
- X-Checksum-Snefru: 3de5c314 60e1ca6a 5252e7c3 c7c31bfe
-
- Submitted-by: rsalz
- Posting-number: Volume 23, Issue 106
- Archive-name: abc/patch1
-
- [ The file bint.h was missing. Oops. The second of two distribution
- patches that do NOT change the released patchlevel. --r$ ]
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then feed it
- # into a shell via "sh file" or similar. To overwrite existing files,
- # type "sh file -c".
- # The tool that generated this appeared in the comp.sources.unix newsgroup;
- # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
- # Contents: bint.h
- # Wrapped by rsalz@litchi.bbn.com on Thu Dec 20 15:24:30 1990
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- echo If this archive is complete, you will see the following message:
- echo ' "shar: End of archive."'
- if test -f 'bint.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'bint.h'\"
- else
- echo shar: Extracting \"'bint.h'\" \(5295 characters\)
- sed "s/^X//" >'bint.h' <<'END_OF_FILE'
- X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1988. */
- X
- X/* interpreter values */
- X
- X/* Types */
- X
- X#define Ptn 'T' /* parsetree */
- X#define How 'h' /* command howto */
- X#define Fun '+' /* function */
- X#define Ref 'r' /* refinement */
- X#define Prd 'i' /* predicate */
- X#define Sim 'S' /* simple location */
- X#define Tri '@' /* trimmed text location */
- X#define Tse '[' /* table selection location */
- X#define Rangebounds 'B' /* for range as list_item */
- X#define Ind 'p' /* indirection node for targets and formals */
- X
- X/************************************************************************/
- X/* environment */
- X/************************************************************************/
- X
- Xtypedef value envtab;
- Xtypedef struct ec{envtab tab; struct ec *inv_env;} envchain;
- Xtypedef envchain *env;
- X
- X/************************************************************************/
- X/* parsetrees */
- X/************************************************************************/
- X
- Xtypedef value parsetree;
- X#define NilTree ((parsetree) Vnil)
- X#define Is_parsetree(v) (Type(v) == Ptn)
- X#define ValidTree(v) ((v) != NilTree)
- X
- X/************************************************************************/
- X/* */
- X/* A function or predicate is modelled as a compound consisting of */
- X/* (i) Zer/Mon/Dya for zero-, mon- or dyadicity; */
- X/* (ii) If a predefined function, an identifying number, otherwise -1 */
- X/* (iii) If a user-defined function/predicate, its parse-tree */
- X/* */
- X/************************************************************************/
- X
- Xtypedef struct {
- X parsetree unit;
- X char /* bool */ unparsed;
- X char /* bool */ filed;
- X parsetree code;
- X} how;
- X
- Xtypedef struct {
- X parsetree unit;
- X char /* bool */ unparsed;
- X char /* bool */ filed;
- X parsetree code;
- X literal adic;
- X intlet pre;
- X} funprd;
- X
- X/* The first four fields of hows and funprds must be the same. */
- X#define Use (-1) /* funprd.pre==Use for user-defined funprds */
- X
- X#define How_to(u) ((how *)Ats(u))
- X#define Funprd(f) ((funprd *)Ats(f))
- X
- Xtypedef value fun;
- Xtypedef value prd;
- X
- Xfun mk_fun();
- Xprd mk_prd();
- Xvalue mk_how();
- X
- X#define Is_howto(v) (Type(v) == How)
- X#define Is_function(v) (Type(v) == Fun)
- X#define Is_predicate(v) (Type(v) == Prd)
- X
- X/************************************************************************/
- X/* refinements */
- X/************************************************************************/
- X
- Xtypedef struct{parsetree rp;} ref;
- X#define Refinement(r) ((ref *)Ats(r))
- X#define Is_refinement(v) (Type(v) == Ref)
- Xvalue mk_ref();
- X
- X/************************************************************************/
- X/* */
- X/* Locations */
- X/* */
- X/* A simple location is modelled as a pair basic-identifier and */
- X/* environment, where a basic-identifier is modelled as a text */
- X/* and an environment as a pointer to a pair (T, E), where T is a */
- X/* table with basic-identifiers as keys and content values as */
- X/* associates, and E is the invoking environment or nil. */
- X/* */
- X/* A trimmed-text location is modelled as a triple (R, B, C). */
- X/* */
- X/* A compound location is modelled as a compound whose fields are */
- X/* locations, rather than values. */
- X/* */
- X/* A table-selection location is modelled as a pair (R, K). */
- X/* */
- X/************************************************************************/
- X
- Xtypedef value loc;
- X#define Lnil ((loc) Vnil)
- X
- Xtypedef value basidf;
- Xtypedef struct{basidf i; env e;} simploc;
- Xtypedef struct{loc R; value B, C;} trimloc;
- Xtypedef struct{loc R; value K;} tbseloc;
- X
- X#define Simploc(l) ((simploc *)Ats(l))
- X#define Tbseloc(l) ((tbseloc *)Ats(l))
- X#define Trimloc(l) ((trimloc *)Ats(l))
- X
- Xloc mk_simploc();
- Xloc mk_trimloc();
- Xloc mk_tbseloc();
- X
- X#define Is_locloc(v) IsSmallInt(v)
- X#define Is_simploc(v) (Type(v) == Sim)
- X#define Is_tbseloc(v) (Type(v) == Tse)
- X#define Is_trimloc(v) (Type(v) == Tri)
- X
- X/************************************************************************/
- X/* rangebounds */
- X/************************************************************************/
- X
- X#define R_LWB(v) ((value) *Field((v), 0))
- X#define R_UPB(v) ((value) *Field((v), 1))
- X#define Is_rangebounds(v) (Type(v) == Rangebounds)
- Xvalue mk_rbounds();
- X
- X/************************************************************************/
- X/* indirection */
- X/************************************************************************/
- X
- Xtypedef struct{value val;} indirect;
- X#define Indirect(v) ((indirect *)Ats(v))
- X#define Is_indirect(v) (Type(v) == Ind)
- Xvalue mk_indirect();
- X
- X/************************************************************************/
- END_OF_FILE
- if test 5295 -ne `wc -c <'bint.h'`; then
- echo shar: \"'bint.h'\" unpacked with wrong size!
- fi
- # end of 'bint.h'
- fi
- echo shar: End of archive.
- exit 0
- exit 0 # Just in case...
-